<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="static/css/admin/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="static/js/common.js"></script>
<script type="text/javascript" src="static/js/jquery.js"></script>
<script type="text/javascript">
function selectsubmit()
{
 document.form1.submit();
}

$(document).ready(function() {
    var prvince = "<{php}> echo $_SESSION['ADMIN_AID'];<{/php}>";
    //品牌选择
	$("#brand").change(function(){
		$.get("<{$weburl}>/index.php?m=ajax&ajax=1", { 
			brandid :  $("#brand").val() 
		}, function (data, textStatus){
               $("#subbrand").html(data); // 把返回的数据添加到页面上
			}
		);
	});
		//品牌选择
	$("#subbrand").change(function(){
		$.get("<{$weburl}>/index.php?m=ajax&ajax=1", { 
			subbrandid :  $("#subbrand").val() 
		}, function (data, textStatus){
               $("#subsubbrand").html(data); // 把返回的数据添加到页面上
			}
		);
	});
	
		   //城市选择
	$("#province").change(function(){
		$.get("<{$weburl}>/index.php?m=ajax&ajax=1", { 
			cityid :  $("#province").val() 
		}, function (data, textStatus){
               $("#city").html(data); // 把返回的数据添加到页面上
			}
		);
	});
	$("input[name*='p_price']").blur(function(){
		var obj=$(this).next();//回调函数前先写入变量;
		$.get("<{$weburl}>/<{$adminpage}>?m=cars&ajax=1", { 
			p_id :  $(this).attr('valueid'),
			price : $(this).val()
		}, function (data){
              obj.html("<img src='static/img/admin/onSuccess.gif' align='absmiddle'/>");
		   }
		);
	});
    if(prvince!=0){
        $('#province').val(prvince);
        $('#province').attr('disabled',true);
        $.get("<{$weburl}>/index.php?m=ajax&ajax=1", {
                    cityid :  prvince
                }, function (data, textStatus){
                    $("#city").html(data); // 把返回的数据添加到页面上
                }
        );
    }
//	//品牌选择
//	$("#brand").change(function(){
//		$.get("<{$weburl}>/index.php?m=ajax&ajax=1", { 
//			bid :  $("#brand").val() 
//		}, function (data, textStatus){
//			$("#subbrand").html(data); // 把返回的数据添加到页面上
//		});
//					
//	});
});
</script>
</head>
<body>
<div class="colorarea01">
	<div class="search clearfix">
		<div class="searchL">
			<ul class="menulist">
                <{php}>
                if(!$_SESSION['ADMIN_AID']){
                <{/php}>
				<li><a href="<{$adminpage}>?m=cars&a=add" class="add">添加车源</a></li>
                <{php}>
                }
                <{/php}>
			</ul>
		</div>
		<{if $setting.version==2 or $setting.version==3}>
        <div class="searchR">统计: 总数: <span class="orange01"><{$pagecount}></span> 条,商家: <{if  $dealercount==''}><span class="orange01">0</span> 条<{else}><span class="orange01"><{$dealercount}></span> 条<{/if}>,
        游客: <{if $visitor==''}><span class="orange01">0</span> 条<{else}><span class="orange01"><{$visitor}></span> 条<{/if}>,
        待审核: <{if $unauditedcount==''}><span class="orange01">0</span> 条<{else}><span class="orange01"><{$unauditedcount}></span> 条<{/if}>,
        已出售: <{if $issellcount==''}><span class="orange01">0</span> 条<{else}><span class="orange01"><{$issellcount}></span> 条<{/if}>,
        未出售: <{if $nosellcount==''}><span class="orange01">0</span> 条<{else}><span class="orange01"><{$nosellcount}></span> 条<{/if}></div>
		<{/if}>
	</div>
    <div class="main clearfix mt10">
	<div class="main_left">
		<div class="search_box">
			<div class="condition">
				<span class="fr pr10"><a href="<{$adminpage}>?m=cars&a=list&clear=1" class="unl blue">清空条件</a></span>
				<span class="fl">您已选择：</span>
				<ul class="condition_list fl">
					<{if $smarty.cookies.status<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&c=s_0" class="condition"><{$arr_status[$smarty.cookies.status]}></a></li><{/if}>
					<{if $smarty.cookies.usertype<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&c=u_0" class="condition"><{$arr_usertype[$smarty.cookies.usertype]}></a></li><{/if}>
					<{if $smarty.cookies.recom<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&c=t_0" class="condition"><{$arr_recom[$smarty.cookies.recom]}></a></li><{/if}>
					<{if $smarty.cookies.keywords<>''}><li><a href="<{$adminpage}>?m=cars&a=list&keywords=" class="condition"><{$smarty.cookies.keywords}></a></li><{/if}>
					<{if $smarty.cookies.brand<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&b=0" class="condition"><{$cache.brandlist[$smarty.cookies.brand]}></a></li><{/if}>
					<{if $smarty.cookies.subbrand<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&sb=0" class="condition"><{$subrandname}></a></li><{/if}>
                    <{if $smarty.cookies.subsubbrand<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&sbsb=0" class="condition"><{$subsubrandname}></a></li><{/if}>
					<{if $smarty.cookies.model<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&c=m_0" class="condition"><{$cache.modellist[$smarty.cookies.model]}></a></li><{/if}>
					<{if $smarty.cookies.price<>0}><li><a href="<{$adminpage}>?m=cars&a=list&c=p_0" class="condition"><{$arr_price[$smarty.cookies.price]}></a></li><{/if}>
					<{if $smarty.cookies.age<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&c=a_0" class="condition"><{$arr_age[$smarty.cookies.age]}></a></li><{/if}>
					<{if $smarty.cookies.gas<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&c=g_0" class="condition"><{$arr_gas[$smarty.cookies.gas]}></a></li><{/if}>
                    <{if $smarty.cookies.province<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&pe=0" class="condition">
                    <{$cache.provincelist[$smarty.cookies.province]}></a></li><{/if}>
                    <{if $smarty.cookies.city<> 0}><li><a href="<{$adminpage}>?m=cars&a=list&cy=0" class="condition">     
                    <{$cache.citylist[$smarty.cookies.city]}></a></li><{/if}>
				</ul>
			</div>
			<ul class="search_list">
                <li>状 态： <a href="<{$adminpage}>?m=cars&a=list&c=s_0"  <{if $smarty.cookies.status==0}>class="here"<{/if}>>全部</a><{foreach from=$arr_status key=skey item=statusllist}><a href="<{$adminpage}>?m=cars&a=list&c=s_<{$skey}>" <{if $smarty.cookies.status==$skey}>class="here"<{/if}>><{$statusllist}></a><{/foreach}>  &nbsp;&nbsp;
					<{if $setting.version==2 or  $setting.version==3}>会员类型： <a href="<{$adminpage}>?m=cars&a=list&c=u_0"  <{if $smarty.cookies.usertype==0}>class="here"<{/if}>>全部</a><{foreach from=$arr_usertype key=skey item=usertypellist}><a href="<{$adminpage}>?m=cars&a=list&c=u_<{$skey}>" <{if $smarty.cookies.usertype==$skey}>class="here"<{/if}>><{$usertypellist}></a><{/foreach}> &nbsp;&nbsp;<{/if}>
					推荐位： <a href="<{$adminpage}>?m=cars&a=list&c=t_0"  <{if $smarty.cookies.recom==0}>class="here"<{/if}>>全部</a><{foreach from=$arr_recom key=skey item=recomllist}><a href="<{$adminpage}>?m=cars&a=list&c=t_<{$skey}>" <{if $smarty.cookies.recom==$skey}>class="here"<{/if}>><{$recomllist}></a><{/foreach}>
				</li>
				<{if $setting.version==3}>
				<form method="get"   action="<{$adminpage}>?m=cars">
				<li>省 市： <a href="<{$adminpage}>?m=cars&a=list&c=c_0" <{if $smarty.cookies.province==0}>class="here"<{/if}>>全部</a>
				<select id="province" name="c">
					<{$selectprovincesearch}>
				</select>
				<select id="city" name="cy">
					<option value="">请选择城市</option>
				</select>
				<input type="hidden" name="m" value="cars">
                <input type="hidden" name="a" value="list">
				<input type="submit" name="filtersubmit" value="查询" class="combutton02 w50">
				</li>
				</form>
				<{/if}>
				<form method="get" action="<{$adminpage}>?m=cars">
				<li>品 牌： <a href="<{$adminpage}>?m=cars&a=list&b=0&keywords=" <{if $smarty.cookies.brand==0 && $smarty.cookies.keywords==''}>class="here"<{/if}>>全部</a>
				<select name="b" id="brand" datatype="n" nullmsg="请选择品牌！">
									<{$selectbrand}>
								</select>
								<select class="subbrand" id="subbrand" name="sb" datatype="n" nullmsg="请选择车系！">
									<option value="" selected>请选择车系</option>                       
								</select> &nbsp;<select class="subbrand" id="subsubbrand" name="sbsb" datatype="n" nullmsg="请选择款式！" style="width:100px;">
								<option value="" selected>请选择款式</option>					              
					</select>
				<input type="hidden" name="m" value="cars">
                <input type="hidden" name="a" value="list">
                 <span>
				<input type="text" name="keywords" id="searchkey" value="" size="16" class="inp01">
				</span>
				<input type="submit" name="filtersubmit" value="查询" class="combutton02 w50">
				</li>
				</form>
				<li>车 型： <a href="<{$adminpage}>?m=cars&a=list&c=m_0" <{if $smarty.cookies.model==0}>class="here"<{/if}>>全部</a><{foreach from=$cache.modellist key=skey item=modellist}><a href="<{$adminpage}>?m=cars&a=list&c=m_<{$skey}>" <{if $smarty.cookies.model==$skey}>class="here"<{/if}>><{$modellist}></a><{/foreach}></li>
                 <form method="get" action="<{$adminpage}>?m=cars">
				<li>价 格： <a href="<{$adminpage}>?m=cars&a=list&c=p_0"  <{if $smarty.cookies.price==0}>class="here"<{/if}>>全部</a><{foreach from=$arr_price key=skey item=pricelist}><a href="<{$adminpage}>?m=cars&a=list&c=p_<{$skey}>" <{if $smarty.cookies.price==$skey}>class="here"<{/if}>><{$pricelist}></a><{/foreach}></li>
                </form>
				<li>车 龄： <a href="<{$adminpage}>?m=cars&a=list&c=a_0"  <{if $smarty.cookies.age==0}>class="here"<{/if}>>全部</a><{foreach from=$arr_age key=skey item=agellist}><a href="<{$adminpage}>?m=cars&a=list&c=a_<{$skey}>" <{if $smarty.cookies.age==$skey}>class="here"<{/if}>><{$agellist}></a><{/foreach}></li>
				<li>排 量： <a href="<{$adminpage}>?m=cars&a=list&c=g_0"  <{if $smarty.cookies.gas==0}>class="here"<{/if}>>全部</a><{foreach from=$arr_gas key=skey item=gasllist}><a href="<{$adminpage}>?m=cars&a=list&c=g_<{$skey}>" <{if $smarty.cookies.gas==$skey}>class="here"<{/if}>><{$gasllist}></a><{/foreach}></li>
			</ul>
		</div>
	<form action="<{$adminpage}>?m=cars" method="POST" name="form" onSubmit="return listsubmitconfirm(this.form)">
	<table cellspacing="0" cellpadding="0" width="100%"  class="listtable mt10">
	<tr><th width="30">选择</th><th>ID</th><th align="left">品牌</th><th>车型</th><th>报价</th><th>上牌日期</th><th>发布时间</th><{if $setting.version==2 or $setting.version==3}><th>会员</th><{/if}><{if $setting.version==3}><th>城市</th><{/if}><th>状态</th><th>点击</th><th width="230">操作</th></tr>
	<{foreach from=$carslist item=cars}>
	<tr bgcolor="#ffffff" onmouseover="style.backgroundColor='#E2E9EA'"  onmouseout="style.backgroundColor='#ffffff'">
	<td align="center"><input type="checkbox" name="bulkid[]" value="<{$cars.p_id}>"></td>
	<td align="center"><{$cars.p_id}></td>
	<td align="left"><a href="<{$cars.p_url}>" target="_blank"><{if $cars.p_allname!=""}><{$cars.p_allname}><{else}><{$cars.p_name}><{/if}></a> <{if $cars.p_pics!=""}><span class="red">图</span><{/if}> 
	<{if $cars.isrecom==1}><span class="red">推荐</span><{/if}> <{if $cars.issprecom==1}><span class="red">特荐</span><{/if}> <{if $cars.ishot==1}><span class="red">热门</span><{/if}></td>
	<td align="center"><{$cars.p_modelname}></td>
	<td align="center" class="red"><{$cars.p_price}>万</span></td>
	<td align="center"><{$cars.p_year}>年<{$cars.p_month}>月</td>
	<td align="center"><{$cars.listtime}></td>
	<{if $setting.version==2 or $setting.version==3}><td align="center"><{$cars.nicname}></td><{/if}>
    <{if $setting.version==3}>
	<td align="center"><{$cars.province}>-<{$cars.city}></td>
	<{/if}>
	<td align="center"><{if $cars.issell==0}><{if $cars.isshow==0}><span class="orange01">未审核<span><{elseif $cars.isshow==2}><span class="green">未通过审核</span><{else}>已通过审核<{/if}><{else}><span class="orange01">已出售</span><{/if}></td>
	<td align="center" class="orange01"><{$cars.p_hits}></td>
	<td align="center" class="rightmenu"><a href="<{$adminpage}>?m=cars&a=check&id=<{$cars.p_id}>&p_state=<{if $cars.isshow==1}>0<{else}>1<{/if}>&page=<{$page}>">审核</a> | <a href="<{$adminpage}>?m=cars&a=edit&id=<{$cars.p_id}>&page=<{$page}>">编辑</a> | <a href="<{$adminpage}>?m=cars&a=refresh&id=<{$cars.p_id}>&page=<{$page}>">刷新</a> | <a href="<{$adminpage}>?m=cars&a=sell&id=<{$cars.p_id}>&issell=<{if $cars.issell==1}>0<{else}>1<{/if}>&page=<{$page}>"><{if $cars.issell==1}>恢复在售<{else}>售出<{/if}></a>
        <{php}>
        if(!$_SESSION['ADMIN_AID']){
        <{/php}>
        | <a href="javascript:if(confirm('确实要删除吗?'))location='<{$adminpage}>?m=cars&a=del&id=<{$cars.p_id}>&page=<{$page}>'">删除</a></td>
        <{php}>
        }
        <{/php}>
	</tr>
	<{/foreach}>
	<tr>
		<td colspan="14" class="buttontd">
			<a href="javascript:javascript:selectAll();" title="请选择后操作">全选</a>
			<a href="javascript:submitForm('<{$adminpage}>?m=cars&a=bulkrefresh&page=<{$page}>','刷新');" title="请选择后操作">刷新</a>
            <{php}>
            if(!$_SESSION['ADMIN_AID']){
            <{/php}>
            <a href="javascript:submitForm('<{$adminpage}>?m=cars&a=bulkdel&page=<{$page}>','删除');" title="请选择后操作">删除</a>
            <{php}>
            }
            <{/php}>

		</td>
	</tr>
	</table>
	</form>
	<div class="listpage"><{$button_basic}><{$button_select}></div>
</div>
</body>
</html>